/*
 * Character.h
 *
 *  Created on: Oct 8, 2011
 *  Created by: Devin Manno
 *  Updated by: Nick James, Devin Manno
 *	Last Update: Oct 13, 2011
 */
#ifndef CHARACTER_H_
#define CHARACTER_H_

//#include "Base.h"
#include "EquipmentType.h"
#include "AttackType.h"
#include "CharacterInventory.h"
#include <string>
#include <sstream>
#include <iostream>
#include <vector>

#define MAX 250
#define DELIMS ",\n"

using std::ostream;
using std::istream;


enum CharClass {WARRIOR, WIZARD, RANGER};

class Character: public Base{
protected:
	CharClass characterClass;		// the character's class
	bool dead;				// the character's state of life/death
	vector<AttackType> attacks;		// a vector of the Character's attack abilities
	vector<bool> unlockedAttacks;		// vector of bools that is same length of attacks
    // it determines if you can use an attack or not
	vector<EquipmentType*> equipment;  // a list of the Character's current equipment
	void loadCharacter(istream&);
	void saveCharacter(ostream&);

public:
	CharacterInventory inventory;			// charachters inventory
	// constructors & destructor
	Character(string characterName, CharClass cClass, std::string objectType);
	Character(string objectType):Base(objectType){}
	virtual ~Character();

	// getters
	int getNumAttacks() const;
	bool isDead() const;			// true if the Character is dead
	bool getAttackType(int attackIndex, AttackType& attack);    // get the AttackType in the attack vector at attackIndex
	const vector<AttackType>* getAttacks();
	const vector<EquipmentType*> * getEquipment() const;         // access to equipment slots for GUI and controller classes
    // usage: const vector<EquipmentType*> items = player.getEquipment();
	CharClass getCharClass() const;

	// setters
	void setDead(bool deadStatus);		// sets character's state of life/death
	void addAttack(const AttackType&);
	void unlockAttack(int);			// takes index to move to unlock

	// virtual function implementations
	std::string getClassName()const;
};

#endif /* CHARACTER_H_ */
